FLAGS := $(LDFLAGS)
CFLAGS := $(CFLAGS) -Wall -pedantic
CXX= g++

#define OUTPUT_STATISTICS 

BINARY = qpi_collector

AGENTSRC = QPIData.cpp QPIProxy.cpp QPICollector.cpp
AGENTOBJ = $(addprefix Build/, $(addsuffix .o, $(basename $(AGENTSRC))))


all: $(AGENTOBJ) 
	${CXX}  $(LDFLAGS) $^ -lm -lrlutils -lrlagent -lrlgluenetdev -o $(BINARY)


Build/%.o: %.cpp
	${CXX}  $(CFLAGS) -o $@  -c $<

clean:
	rm -rf $(BINARY) core* Build/*.o

kill: 
	killall -9 $(BINARY)
run:
	./$(BINARY) 127.0.0.1 4096 > result.out & 
	tailf result.out | grep episode 

